package cn.kgc.ssm.handlers;

import cn.kgc.ssm.commons.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 课工场
 * @date 2024/5/14
 * @description  全局异常处理类
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResponseResult  allExceptionHandler(Exception e){

        e.printStackTrace();
        return  ResponseResult.error().message("服务器异常...");
    }
}
